#include <algorithm>
#include <cstdio>
#define N 200
using namespace std;

int n, m, k, ans = -0x7fffffff;
int map[N][N];
void dfs(int step, int last_col, int last_row, int score) {
	if (step == k && last_col == m) {
		ans = max(ans, score);
		return;
	}
	if (step > k) {
		return;
	}
	if (last_col == m) {
		return;
	}
	if (k - step > m - last_col) {
		return;
	}
	if (step & 1) {
		dfs(step, last_col + 1, last_row, score + map[last_row][last_col + 1]);
		for (int i = last_row - 1; i; --i) {
			dfs(step + 1, last_col + 1, i, score + map[i][last_col + 1]);
		}
	} else {
		dfs(step, last_col + 1, last_row, score + map[last_row][last_col + 1]);
		for (int i = last_row + 1; i <= n; ++i) {
			dfs(step + 1, last_col + 1, i, score + map[i][last_col + 1]);
		}
	}
}
int main() {
	freopen("testdata.in", "r", stdin);
	freopen("testdata.out", "w", stdout);
	scanf("%d%d%d", &n, &m, &k);
	int tmp = 0;
	k = (k << 1) + 1;
	for (int i = n; i; --i) {
		for (int j = 1; j <= m; ++j) {
			scanf("%d", &tmp);
			map[i][j] = tmp;
		}
	}
	for (int i = 2; i <= n; ++i) {
		for (int j = 1; j <= m; ++j) {
			map[i][j] = map[i][j] + map[i - 1][j];
		}
	}
	dfs(0, 0, 0, 0);
	printf("%d", ans);
	fclose(stdin);
	fclose(stdout);
	return 0;
}